import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { AppCommonModule } from '@app/shared/common/app-common.module';
import { UtilsModule } from '@shared/utils/utils.module';
import { CountoModule } from 'angular2-counto';
import { ModalModule, TabsModule, TooltipModule, BsDropdownModule, PopoverModule } from 'ngx-bootstrap';
import { NgxChartsModule } from '@swimlane/ngx-charts';
import {
    BsDatepickerModule,
    BsDatepickerConfig,
    BsDaterangepickerConfig,
    BsLocaleService
} from 'ngx-bootstrap/datepicker';
import { NgxBootstrapDatePickerConfigService } from 'assets/ngx-bootstrap/ngx-bootstrap-datepicker-config.service';
import { TableModule } from 'primeng/table';
import {
    CalendarModule,
    TreeModule,
    DragDropModule,
    ContextMenuModule,
    PaginatorModule,
    InputMaskModule,
    EditorModule,
    AutoCompleteModule,
    FileUploadModule,
    CheckboxModule,
    MultiSelectModule
} from 'primeng/primeng';

import { ImageCropperModule } from 'ngx-image-cropper';
import { TextMaskModule } from 'angular2-text-mask';
import { TreeTableModule } from 'primeng/treetable';
import { StockToolingRoutingModule } from './stock-tooling-routing.module';
import { ToolingAccountComponent } from './tooling/account/tooling-account.component';
import { ToolingIntoComponent } from './tooling/into/tooling-into.component';
import { CreateOrEditToolingIntoBillModalComponent } from './tooling/into/create-or-edit-tooling-into-bill-modal.component';
import { CreateOrEditToolingIntoBillItemModalComponent } from './tooling/into/create-or-edit-tooling-into-bill-item-modal.component';
import { ToolingScrapComponent } from './tooling/scrap/tooling-scrap.component'
import { CreateOrEditToolingScrapBillModalComponent } from './tooling/scrap/create-or-edit-tooling-scrap-bill-item-modal.component'
import { ToolingLostIndexComponent } from './tooling/lost/tooling-lost-index.component';
import { CreateOrEditToolingLostBillModalComponent } from './tooling/lost/create-or-edit-tooling-lost-bill-item-modal.component';
import { ToolingLostAccountComponent } from './tooling/lost/tooling-lost-account.component';
import { CreateToolingLostOpinionModalComponent } from './tooling/lost/create-or-edit-tooling-lost-opinion-modal.component';
import { ToolingMaintainComponent } from './tooling/maintain/tooling-maintain.component';
import { CreateOrEditToolingMaintainBillModalComponent } from './tooling/maintain/create-or-edit-tooling-maintain-bill-item-modal.component';
import { UpdateMaintainToolingStatusModalComponent } from './tooling/maintain/update-status-modal.component';
import { CreateToolingMaintainOpinionModalComponent } from './tooling/maintain/create-or-edit-tooling-maintain-opinion-modal.component';
import { ToolingBaseInfoComponent } from './tooling/base/tooling-base-info.component';
import { CreateOrEditToolingReceiveBillModalComponent } from './tooling/receive/create-or-edit-tooling-receive-bill-item-modal.component';
import { CreateToolingReceiveOpinionModalComponent } from './tooling/receive/create-or-edit-tooling-receive-opinion-modal.component';
import { ToolingReceiveComponent } from './tooling/receive/tooling-receive.component';
import { ToolingSearchReceiveComponent } from './tooling/receive/tooling-search-receive.component';
import { UpdateToolingAccountRemarkModalComponent } from './tooling/account/updatetooling-account-remark-modal.component';
import { ToolingMaintainAccountComponent } from './tooling/account/tooling-maintain-account.component';
import { ToolingDeptAccountComponent } from './tooling/account/tooling-dept-account.component';
import { ToolingAccountRecordModalComponent } from './tooling/account/tooling-record-modal.component';
import { ToolingAccountBaseInfoModalComponent } from './tooling/account/tooling-account-base-info-modal.component';
import { ToolingBaseFieldComponent } from './tooling/base/tooling-basefield.component';
import { CreateOrEditToolingBaseInfoModalComponent } from './tooling/base/create-or-edit-tooling-baseinfo-modal.component';
import { ToolingBaseFieldDetailModalComponent } from './tooling/base/tooling-basefield-detail-modal.component';
import { ToolingBaseInfoModalComponent } from './tooling/into/tooling-base-info-modal.component';
import { ToolingBorrowOutComponent } from './tooling/borrowout/tooling-borrow-out.component';
import { ToolingBorrowComponent } from './tooling/borrow/tooling-borrow.component';
import { CreateOrEditToolingBorrowOutBillModalComponent } from './tooling/borrowout/create-or-edit-tooling-borrow-out-bill-item-modal.component';
import { CreateToolingBorrowOutOpinionModalComponent } from './tooling/borrowout/create-or-edit-tooling-borrowout-opinion-modal.component';
import { ToolingOutReturnModalComponent } from './tooling/borrowout/tooling-out-return-modal.component';
import { CreateOrEditToolingBorrowBillModalComponent } from './tooling/borrow/create-or-edit-tooling-borrow-bill-item-modal.component';
import { ToolingReturnModalComponent } from './tooling/borrow/tooling-return-modal.component';
import { ToolingUserCardModalComponent } from './tooling/borrow/tooling-user-card-modal.component';
import { ToolingTransferComponent } from './tooling/toolingtransfer/toolingtransfer.component';
import { CreateOrEditToolingTransferModalComponent } from './tooling/toolingtransfer/create-or-edit-tooling-transfer-modal.component';
import { CreateToolingTransferOpinionModalComponent } from './tooling/toolingtransfer/create-or-edit-tooling-transfer-opinion-modal.component';
import { ToolingCancelComponent } from './tooling/cancel/tooling-cancel.component';
import { CreateOrEditToolingCancelBillModalComponent } from './tooling/cancel/create-or-edit-tooling-cancel-bill-item-modal.component';
import { CreateToolingScrapOpinionModalComponent } from './tooling/scrap/create-or-edit-tooling-scrap-opinion-modal.component';
NgxBootstrapDatePickerConfigService.registerNgxBootstrapDatePickerLocales();

@NgModule({
    imports: [
        FormsModule,
        CommonModule,
        FileUploadModule,
        ModalModule.forRoot(),
        TabsModule.forRoot(),
        TooltipModule.forRoot(),
        PopoverModule.forRoot(),
        BsDropdownModule.forRoot(),
        BsDatepickerModule.forRoot(),
        StockToolingRoutingModule,
        UtilsModule,
        AppCommonModule,
        TableModule,
        TreeModule,
        DragDropModule,
        ContextMenuModule,
        PaginatorModule,
        AutoCompleteModule,
        EditorModule,
        InputMaskModule,
        NgxChartsModule,
        CountoModule,
        TextMaskModule,
        ImageCropperModule,
        CheckboxModule,
        TreeTableModule,
        CalendarModule,
        MultiSelectModule
    ],
    declarations: [
        ToolingReceiveComponent,
        CreateOrEditToolingBaseInfoModalComponent,
        ToolingSearchReceiveComponent,
        UpdateToolingAccountRemarkModalComponent,
        ToolingAccountRecordModalComponent,
        ToolingMaintainAccountComponent,
        ToolingDeptAccountComponent,
        ToolingAccountBaseInfoModalComponent,
        ToolingBaseFieldComponent,
        ToolingBaseFieldDetailModalComponent,
        ToolingBaseInfoComponent,
        ToolingTransferComponent,
        CreateOrEditToolingTransferModalComponent,
        CreateToolingTransferOpinionModalComponent,
        CreateToolingReceiveOpinionModalComponent,
        CreateOrEditToolingReceiveBillModalComponent,
        ToolingBaseInfoModalComponent,
        // 工装
        ToolingAccountComponent,
        ToolingIntoComponent,
        CreateOrEditToolingIntoBillModalComponent,
        CreateOrEditToolingIntoBillItemModalComponent,
        ToolingScrapComponent,
        CreateOrEditToolingScrapBillModalComponent, 
        ToolingSearchReceiveComponent,
        ToolingBorrowOutComponent, 
        ToolingBorrowComponent,
        ToolingMaintainAccountComponent,
        ToolingDeptAccountComponent,
        CreateToolingScrapOpinionModalComponent,
        CreateOrEditToolingBorrowOutBillModalComponent,
        ToolingUserCardModalComponent,
        ToolingReturnModalComponent,
        CreateOrEditToolingBorrowBillModalComponent,
        CreateToolingBorrowOutOpinionModalComponent,
        ToolingOutReturnModalComponent,

        //工装丢失
        ToolingLostIndexComponent,
        CreateOrEditToolingLostBillModalComponent,
        ToolingLostAccountComponent,
        CreateToolingLostOpinionModalComponent,
        //工装维修
        ToolingMaintainComponent,
        CreateOrEditToolingMaintainBillModalComponent,
        ToolingMaintainAccountComponent,
        UpdateMaintainToolingStatusModalComponent,
        CreateToolingMaintainOpinionModalComponent,
        //工装退库
        ToolingCancelComponent,
        CreateOrEditToolingCancelBillModalComponent
    ],

    providers: [
        {
            provide: BsDatepickerConfig,
            useFactory: NgxBootstrapDatePickerConfigService.getDatepickerConfig
        },
        {
            provide: BsDaterangepickerConfig,
            useFactory: NgxBootstrapDatePickerConfigService.getDaterangepickerConfig
        },
        {
            provide: BsLocaleService,
            useFactory: NgxBootstrapDatePickerConfigService.getDatepickerLocale
        }
    ]
})
export class StockToolingModule { }
